home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 205 / MF_UK_205_1.iso / pc / DiscContents / In the mag / Widgets / Tri Peaks Solitaire 1.0 / Widget / Tri Peaks Solitaire.wdgt / main.js < prev    next >
Encoding:
JavaScript  |  2008-12-18  |  2.6 KB  |  123 lines

  1. /* 
  2.  This file was generated by Dashcode.  
  3.  You may edit this file to customize your widget or web page 
  4.  according to the license.txt file included in the project.
  5.  */
  6.  
  7. //
  8. // Function: load()
  9. // Called by HTML body element's onload event when the widget is ready to start
  10. //
  11. function load()
  12. {
  13.     dashcode.setupParts();
  14. }
  15.  
  16. //
  17. // Function: remove()
  18. // Called when the widget has been removed from the Dashboard
  19. //
  20. function remove()
  21. {
  22.     // Stop any timers to prevent CPU usage
  23.     // Remove any preferences as needed
  24.     // widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey("your-key"));
  25. }
  26.  
  27. //
  28. // Function: hide()
  29. // Called when the widget has been hidden
  30. //
  31. function hide()
  32. {
  33.     // Stop any timers to prevent CPU usage
  34. }
  35.  
  36. //
  37. // Function: show()
  38. // Called when the widget has been shown
  39. //
  40. function show()
  41. {
  42.     // Restart any timers that were stopped on hide
  43. }
  44.  
  45. //
  46. // Function: sync()
  47. // Called when the widget has been synchronized with .Mac
  48. //
  49. function sync()
  50. {
  51.     // Retrieve any preference values that you need to be synchronized here
  52.     // Use this for an instance key's value:
  53.     // instancePreferenceValue = widget.preferenceForKey(null, dashcode.createInstancePreferenceKey("your-key"));
  54.     //
  55.     // Or this for global key's value:
  56.     // globalPreferenceValue = widget.preferenceForKey(null, "your-key");
  57. }
  58.  
  59. //
  60. // Function: showBack(event)
  61. // Called when the info button is clicked to show the back of the widget
  62. //
  63. // event: onClick event from the info button
  64. //
  65. function showBack(event)
  66. {
  67.     var front = document.getElementById("front");
  68.     var back = document.getElementById("back");
  69.  
  70.     if (window.widget) {
  71.         widget.prepareForTransition("ToBack");
  72.     }
  73.  
  74.     front.style.display = "white";
  75.     back.style.display = "block";
  76.  
  77.     if (window.widget) {
  78.         setTimeout('widget.performTransition();', 0);
  79.     }
  80. }
  81.  
  82. //
  83. // Function: showFront(event)
  84. // Called when the done button is clicked from the back of the widget
  85. //
  86. // event: onClick event from the done button
  87. //
  88. function showFront(event)
  89. {
  90.     var front = document.getElementById("front");
  91.     var back = document.getElementById("back");
  92.  
  93.     if (window.widget) {
  94.         widget.prepareForTransition("ToFront");
  95.     }
  96.  
  97.     front.style.display="block";
  98.     back.style.display="none";
  99.  
  100.     if (window.widget) {
  101.         setTimeout('widget.performTransition();', 0);
  102.     }
  103. }
  104.  
  105. if (window.widget) {
  106.     widget.onremove = remove;
  107.     widget.onhide = hide;
  108.     widget.onshow = show;
  109.     widget.onsync = sync;
  110. }
  111.  
  112.  
  113. function getSkillpod(event)
  114. {
  115.     // Insert Code Here
  116.      {
  117.         if (widget)
  118.         {
  119.             widget.openURL('http://www.skillpod.com');
  120.         }
  121.     }
  122. }
  123.